<?php

namespace App\Models\Product;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Lease extends Model
{
    use HasFactory;

    use SoftDeletes;

    protected $table = 'lease';

    // 自动写入时间戳
    public $timestamps = true;

    // 时间类型
    protected $dateFormat = 'U';

    // 自定义创建时间字段
    const CREATED_AT = null;

    // 自定义更新时间字段
    const UPDATED_AT = null;

    // 软删除字段
    const DELETED_AT = 'deletetime';

    protected $guarded = [];

    public function product()
    {
        return $this->belongsTo(\App\Models\Product\Product::class,'proid','id');
    }
}
